package com.nari.ysphd.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.nari.ysphd.R;
import com.jeremyfeinstein.gson.SelectItem;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/2/2.
 */

public class ResourceAdapter extends NewBaseAdapter {
    List<SelectItem> meetingTypes;
    private Context mContext;
    public ResourceAdapter(Context context) {
        mContext = context;
        meetingTypes = new ArrayList<>();
        meetingTypes.add(new SelectItem(1, "网省"));
       // meetingTypes.add(new SelectItem(2, "总部"));
    }

    @Override
    public int getCount() {
        return meetingTypes == null ? 0 : meetingTypes.size();
    }

    @Override
    public Object getItem(int position) {
        return meetingTypes.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = View.inflate(mContext, R.layout.item_select,
                    null);
        }
        TextView locationName = (TextView) convertView
                .findViewById(R.id.item_name2);
        SelectItem selectItem = (SelectItem) getItem(position);
        locationName.setText(selectItem.getName());
        return convertView;
    }


    @Override
    public void refreshList(String text) {
    }
}